/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * exitFrame.java
 *
 * Created on Oct 31, 2011, 7:39:06 PM
 */

package giormi;

import javax.swing.JFrame;

/**
 *
 * @author Ling
 */
public class exitFrame extends javax.swing.JFrame {

    /** Creates new form exitFrame */
    JFrame main;
    public exitFrame(JFrame mf) {
        initComponents();
        this.setLocation(440, 240);
        this.setSize(380, 170);
        this.setResizable(false);
        this.setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
        main=mf;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        addsuccess = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Confirm Exit");
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        addsuccess.setText("Confirm Exit. Are you sure you wish to exit?");
        getContentPane().add(addsuccess, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 20, -1, 70));

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/giormi/sources/Close-2-icon.png"))); // NOI18N
        jButton1.setText("Cancel");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 90, 90, -1));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/giormi/sources/Button-Warning-icon (1).png"))); // NOI18N
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, -1, -1));

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/giormi/sources/Ok-icon.png"))); // NOI18N
        jButton2.setText("OK");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 90, 90, -1));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        main.setEnabled(true);
        this.setVisible(false);
        this.dispose();
}//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jButton2ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel addsuccess;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables

}
